package com.trinity.specialpay.service.impl;

import com.trinity.common.utils.DateUtils;
import com.trinity.specialpay.domain.CampusActivity;
import com.trinity.specialpay.mapper.CampusActivityMapper;
import com.trinity.specialpay.service.ICampusActivityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 缴费项目Service业务层处理
 *
 * @author trinity
 * @date 2023-11-19
 */
@Service
public class CampusActivityServiceImpl implements ICampusActivityService {
    @Autowired
    private CampusActivityMapper campusActivityMapper;

    /**
     * 查询缴费项目
     *
     * @param actId 缴费项目主键
     * @return 缴费项目
     */
    @Override
    public CampusActivity selectCampusActivityByActId(Long actId)
    {
        return campusActivityMapper.selectCampusActivityByActId(actId);
    }

    /**
     * 查询缴费项目列表
     *
     * @param campusActivity 缴费项目
     * @return 缴费项目
     */
    @Override
    public List<CampusActivity> selectCampusActivityList(CampusActivity campusActivity)
    {
        return campusActivityMapper.selectCampusActivityList(campusActivity);
    }

    /**
     * 新增缴费项目
     *
     * @param campusActivity 缴费项目
     * @return 结果
     */
    @Override
    public int insertCampusActivity(CampusActivity campusActivity)
    {
        campusActivity.setCreateTime(DateUtils.getNowDate());
        return campusActivityMapper.insertCampusActivity(campusActivity);
    }

    /**
     * 修改缴费项目
     *
     * @param campusActivity 缴费项目
     * @return 结果
     */
    @Override
    public int updateCampusActivity(CampusActivity campusActivity)
    {
        campusActivity.setUpdateTime(DateUtils.getNowDate());
        return campusActivityMapper.updateCampusActivity(campusActivity);
    }

    /**
     * 批量删除缴费项目
     *
     * @param actIds 需要删除的缴费项目主键
     * @return 结果
     */
    @Override
    public int deleteCampusActivityByActIds(Long[] actIds)
    {
        return campusActivityMapper.deleteCampusActivityByActIds(actIds);
    }

    /**
     * 删除缴费项目信息
     *
     * @param actId 缴费项目主键
     * @return 结果
     */
    @Override
    public int deleteCampusActivityByActId(Long actId) {
        return campusActivityMapper.deleteCampusActivityByActId(actId);
    }
}
